<?php
namespace Home\Controller;
use Think\Controller;
class NewController extends Controller
{
    /**
     * 新闻资讯
     * @author 佛祖<381361943@qq.com>
     */
    public function index()
    {
        $list = $this->paging(I('p',1),M('new'),6);
       // print_r($list);die;
        $this->assign('list',$list['list']);
        $this->assign('page',$list['page']);
        $this->display();
    }
    /**
     * 新闻资讯详情页
     * @author 佛祖<381361943@qq.com>
     */
    public function detail()
    {
        $id = I('id','');
        if($id == '')
            $this->error('错误的参数');
        $list = M('new')->find($id);
        if(!$list)
            $this->error('暂无数据');
        $this->assign('list',$list);
        $this->display();
    }

}